package com.cl.short_video_java.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.cl.short_video_java.dto.UserDto;
import com.cl.short_video_java.dto.VideoDto;
import lombok.Data;

/**
 * @TableName video_video
 */
@TableName(value = "video_video")
@Data
public class VideoVideo implements Serializable {
	/**
	 * 视频表
	 */
	@TableId(type = IdType.AUTO)
	private Integer id;

	/**
	 *
	 */
	private String videoUrl;

	/**
	 *
	 */
	private Date createTime;

	/**
	 * 发布者
	 */
	private Integer userId;

	/**
	 * 分类楼层
	 */
	private String typeFloor;

	/**
	 * 视频首图
	 */
	private String firstImgUrl;

	/**
	 * 观看人数
	 */
	private Long lookCount = 0L;

	/**
	 * 视频类型：0-普通，1-会员，2-金币
	 */
	private Integer type;

	/**
	 * 金币数量
	 */
	private Long gold;

	/**
	 * 点赞数量
	 */
	private Long thumbUp = 0L;

	/**
	 * 收藏数量
	 */
	private Long collection = 0L;

	/**
	 * 状态：0-未审核，1-正常，2-未通过
	 */
	private Integer status;

	/**
	 * 是否删除：0-正常，1-删除
	 */
	private Integer isDelete = 0;

	/**
	 * 审核用户
	 */
	private Integer adminId;
	private Integer typeId;
	private String tags;
	private String title;
	private Integer isRecommend = 0;
	private Integer sort = 0;

	@TableField(value = "`desc`")
	private String desc;


	@TableField(exist = false)
	private static final long serialVersionUID = 1L;

	@TableField(exist = false)
	private VideoType videoType;
	@TableField(exist = false)
	private List<VideoType> videoTypeList;

	@TableField(exist = false)
	private VideoUser user;
	@TableField(exist = false)
	private UserDto userDto;
	@TableField(exist = false)
	private String adminName;;
	@TableField(exist = false)
	private String userName;

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		VideoVideo other = (VideoVideo) that;
		return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
				&& (this.getVideoUrl() == null ? other.getVideoUrl() == null : this.getVideoUrl().equals(other.getVideoUrl()))
				&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
				&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
				&& (this.getTypeFloor() == null ? other.getTypeFloor() == null : this.getTypeFloor().equals(other.getTypeFloor()))
				&& (this.getFirstImgUrl() == null ? other.getFirstImgUrl() == null : this.getFirstImgUrl().equals(other.getFirstImgUrl()))
				&& (this.getLookCount() == null ? other.getLookCount() == null : this.getLookCount().equals(other.getLookCount()))
				&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
				&& (this.getGold() == null ? other.getGold() == null : this.getGold().equals(other.getGold()))
				&& (this.getThumbUp() == null ? other.getThumbUp() == null : this.getThumbUp().equals(other.getThumbUp()))
				&& (this.getCollection() == null ? other.getCollection() == null : this.getCollection().equals(other.getCollection()))
				&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
				&& (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
				&& (this.getAdminId() == null ? other.getAdminId() == null : this.getAdminId().equals(other.getAdminId()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
		result = prime * result + ((getVideoUrl() == null) ? 0 : getVideoUrl().hashCode());
		result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
		result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
		result = prime * result + ((getTypeFloor() == null) ? 0 : getTypeFloor().hashCode());
		result = prime * result + ((getFirstImgUrl() == null) ? 0 : getFirstImgUrl().hashCode());
		result = prime * result + ((getLookCount() == null) ? 0 : getLookCount().hashCode());
		result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
		result = prime * result + ((getGold() == null) ? 0 : getGold().hashCode());
		result = prime * result + ((getThumbUp() == null) ? 0 : getThumbUp().hashCode());
		result = prime * result + ((getCollection() == null) ? 0 : getCollection().hashCode());
		result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
		result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
		result = prime * result + ((getAdminId() == null) ? 0 : getAdminId().hashCode());
		return result;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(getClass().getSimpleName());
		sb.append(" [");
		sb.append("Hash = ").append(hashCode());
		sb.append(", id=").append(id);
		sb.append(", videoUrl=").append(videoUrl);
		sb.append(", createTime=").append(createTime);
		sb.append(", userId=").append(userId);
		sb.append(", typeFloor=").append(typeFloor);
		sb.append(", firstImgUrl=").append(firstImgUrl);
		sb.append(", lookCount=").append(lookCount);
		sb.append(", type=").append(type);
		sb.append(", gold=").append(gold);
		sb.append(", like=").append(thumbUp);
		sb.append(", collection=").append(collection);
		sb.append(", status=").append(status);
		sb.append(", isDelete=").append(isDelete);
		sb.append(", adminId=").append(adminId);
		sb.append(", serialVersionUID=").append(serialVersionUID);
		sb.append("]");
		return sb.toString();
	}
}